import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { SharedModule } from '../shared/shared.module';
import { StockDashboardComponent } from './stock-dashboard/stock-dashboard.component';
import { AlertRulesComponent } from './alert-rules/alert-rules.component';
import { NgxEchartsModule } from 'ngx-echarts';
import * as echarts from 'echarts';

// 导入NG-ZORRO模块
import { NzTableModule } from 'ng-zorro-antd/table';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzGridModule } from 'ng-zorro-antd/grid';
import { NzCardModule } from 'ng-zorro-antd/card';

@NgModule({
  declarations: [
    // StockDashboardComponent 已移至imports数组
  ],
  imports: [
    CommonModule,
    SharedModule,
    StockDashboardComponent, // 作为standalone组件，应在imports数组中导入
    AlertRulesComponent, // 添加预警规则组件
    NgxEchartsModule.forRoot({
      echarts: () => echarts
    }),
    // 添加NG-ZORRO模块
    NzTableModule,
    NzIconModule,
    NzGridModule,
    NzCardModule,
    RouterModule.forChild([
      {
        path: '',
        component: StockDashboardComponent
      },
      {
        path: 'alert-rules',
        component: AlertRulesComponent,
        data: { breadcrumb: '预警规则管理' }
      }
    ])
  ]
})
export class DashboardModule { } 